package com.cloudkinto.controller.app;


import com.cloudkinto.bo.api.InboundReceiptAndShelfApiBo;
import com.cloudkinto.common.annotations.UserSessionRequired;
import com.cloudkinto.service.app.vo.AppUpdateNewestRes;
import io.swagger.annotations.ApiResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.cloudkinto.service.app.AppUpdateService;

import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;

import java.util.HashMap;
import java.util.Map;

import com.cloudkinto.base.BaseController;

/**
 * <p>
 *  前端控制器
 * </p>
 * @author long
 * @since 2025-08-13
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "app版本更新模块")
@RequestMapping("/api/admin/app/AppUpdate")
public class AppUpdateController extends BaseController {
    private final Logger logger = LoggerFactory.getLogger(AppUpdateController.class);

    private final AppUpdateService service;


    @GetMapping("/getTwoAppNewestVersion")
    @ApiOperation(value = "获取app版本信息")
    @ApiResponse(code = 200, message = "")
    public SingleResult getTwoAppNewestVersion(HttpServletRequest request) {
        AppUpdateNewestRes res = service.getTwoAppNewestVersion();
        return SingleResult.success(res);
    }



    @GetMapping("/downTwoAppNewest")
    @ApiOperation(value = "下载app信息")
    @ApiResponse(code = 200, message = "")
    public void downTwoAppNewest(HttpServletRequest request, HttpServletResponse response) {
        service.downTwoAppNewest(response);
    }
}

